//
//  TabBarButton.m
//  u76ho
//
//  Created by m-air-01 on 15/12/25.
//  Copyright © 2015年 LV. All rights reserved.
//

#import "TabBarButton.h"

@implementation TabBarButton
-(id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}
#pragma mark 设置button内部的image的范围

- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    
    if ([_single isEqualToString:@"1"]) {
        
        CGFloat imageW = contentRect.size.width;
        CGFloat imageH = contentRect.size.height * 0.6;
        
        return CGRectMake(0, 0, imageW, imageH);

    }
    else
    {
        CGFloat imageW = contentRect.size.width;
        CGFloat imageH = contentRect.size.height * 0.6;
        
        return CGRectMake(0, 5, imageW, imageH);

    }
    
}

#pragma mark 设置button内部的title的范围

- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleY = contentRect.size.height * 0.6;
    CGFloat titleW = contentRect.size.width;
    CGFloat titleH = contentRect.size.height - titleY;
    
    return CGRectMake(0, titleY, titleW, titleH);
    
}

@end
